#version 440
//When specifying only a fragment shader, the texture coordinates are passed in from the built-in vertex shader as vec2 qt_TexCoord0 at location 0
//如果仅提供片段着色器，纹理坐标会从内置的顶点着色器传递，位置为0
layout(location = 0) in vec2 qt_TexCoord0;
//The fragment shader must have a vec4 output at location 0 (typically called fragColor)
layout(location = 0) out vec4 fragColor;
layout(std140, binding = 0) uniform buf {
    mat4 qt_Matrix;
    float qt_Opacity;
};
//Samplers must use binding points starting from 1
layout(binding = 1) uniform sampler2D source;
void main() {
    vec4 tex = texture(source, qt_TexCoord0);
    fragColor = vec4(vec3(dot(tex.rgb, vec3(0.344, 0.5, 0.156))), tex.a) * qt_Opacity;
}
